//
//  SSDetailScrollCell.m
//  starspaceVR
//
//  Created by 曹端芹 on 17/9/14.
//  Copyright © 2017年 starspace. All rights reserved.
//

#import "SSDetailScrollCell.h"
#define pictureURL @"http://www.vrspaces.cn"

@implementation SSDetailScrollCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;

}

- (void)setModel:(SSAppliDetailModel *)model {
    _model = model;
    
    NSMutableArray *photos = [NSMutableArray array];
    for (NSDictionary *dict in model.photos) {
        NSString *photo = [NSString stringWithFormat:@"%@%@",pictureURL,dict[@"src"]] ;
        [photos addObject:photo];
    }
    CGRect scrollFrame = CGRectMake(10, 10, kScreenWidth - 20, 160);
    SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:scrollFrame imageNamesGroup:photos];
    cycleScrollView.currentPageDotColor = [UIColor orangeColor];
    cycleScrollView.pageDotColor = [UIColor whiteColor];
    cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight;
    [self.contentView addSubview:cycleScrollView];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
